<?php

class TestQueryController extends CController {
	
	public function actionBuilder() {
		$rows = Yii::app()->db->createCommand()
						->from('user')
						->queryAll();
		$this->renderRows($rows);
	}
	
	public function actionSql() {
		$sql = "select * from user";
		
		$rows = Yii::app()->db->createCommand($sql)->queryAll();
		
		$this->renderRows($rows);
		//echo "$row[0]";
	}
	
	public function renderRows($rows) {
		foreach ($rows as $row) {
			echo $row['pass'];
		}
	}
}
